# -*- coding: utf-8 -*-

class TItemInfo(dict):
    def __init__(self):
        dict.__init__(self)

    def asDict(self):
        data = {
            "itemId": self["itemId"],
            "number": self["number"]
        }
        return data

    def createFromDict(self, dictData):
        self["itemId"] = dictData["itemId"]
        self["number"] = dictData["number"]
        return self

class ITEM_INFO:
    def __init__(self):
        pass

    def createObjFromDict(self, dict):
        return TItemInfo().createFromDict(dict)

    def getDictFromObj(self, obj):
        return obj.asDict()

    def isSameType(self, obj):
        return isinstance(obj, TItemInfo)

item_info_inst = ITEM_INFO()